package com.eonmind.ai.controller;

import com.eonmind.ai.dto.AiBiDto;
import com.eonmind.ai.service.impl.AiBiService;
import com.eonmind.common.contract.data.response.ResponseEntity;
import com.eonmind.common.security.annotations.UserInfo;
import com.eonmind.user.contract.dto.UserInfoData;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * AI 统计数据控制器
 *
 * @author Xujie
 * @since 2025/5/29 21:21
 **/
@RequiredArgsConstructor
@RestController
public class AiBiController {
    private final AiBiService aiBiService;

    /**
     * 获取用户消费数据
     *
     * @param request 请求参数
     * @return
     * @ignoreParams userInfoData
     * @
     */
    @UserInfo
    @PostMapping("/ai/bi/getUserConsumeData")
    public ResponseEntity<List<AiBiDto.UserConsumeData>>
    getUserConsumeData(UserInfoData userInfoData, @RequestBody AiBiDto.UserConsumeDataRequest request) {
        List<AiBiDto.UserConsumeData> userConsumeDataList = aiBiService.getUserConsumeData(userInfoData, request);
        return ResponseEntity.success(userConsumeDataList);
    }

}
